Algorithm To Fix Corner Twist